import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/Home'
import Find from '@/views/Find'
import News from '@/views/News'
import My from '@/views/My'
import Layout from '@/views/Layout'
import Login from '@/views/Login'
import Register from '@/views/Register'
import Collect from '@/views/Collect'
import Chuzu from '@/views/Chuzu'
import Rent from '@/views/Rent'
import CityList from '@/views/CityList'
Vue.use(VueRouter)

const routes = [
  {
    path: '/citylist',
    component: CityList
  },
  {
    path: '/rent',
    component: Rent
  },
  {
    path: '/chuzu',
    component: Chuzu
  },
  {
    path: '/collect',
    component: Collect
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/register',
    component: Register
  },
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: '/home',
        component: Home
      },
      {
        path: '/find',
        component: Find
      },
      {
        path: '/news',
        component: News
      },
      {
        path: '/my',
        component: My
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
